package com.sinaapp.gavinzhang.GSpider.config;

/**
 * Created by Gavin on 2015-11-20.
 */
public class Constants {

    /**
     * http URI
     */
    public static final String BASIC = "/";
    public static final String STATUS = "/status";
    public static final String HELLO = "/hello";

    /**
     * http string
     */
    public static final String TITLE = "GSpider";
    public static final String HEADER = "HTTP/1.1 200 OK\r\nContent-Type:text/html;charset=gbk\r\nServer:gspider\r\n";
    public static final String LINE_FEED = "\r\n";
    public static final String DOUBLE_LINE_FEED = "\r\n";


    public static final int BUFFSIZE = 1024;

    /**
     * gspider
     */
    public static final String GSPIDER_INIT_SUCCESS = "Gspider Init Succuess";
    public static final String GSPIDER_CONTROL_INIT_SUCCESS = "Gspider Control Init Success";
    public static final String HTTP_SERVER_INIT_SUCCESS = "Gspider HttpServer Beta Launch Success";
    public static final String GSPIDER_START_SUCCESS = "GSpider Start Success";
    public static final String GSPIDER_START_ERROR = "Launch a started Gspider";
    public static final String GSPIDER_STOP = "Gspider stop";
    public static final String LOAD_DEFAULT_PAGE_PROCESSOR = "加载默认页面处理类";
    public static final String COMMAND_LINE = "command input:";
    public static final String GSPIDER_INIT_ERROR = "爬虫未初始化";
    public static final String ADD_URL_ERROR = "addWebUrl error";
    public static final String NO_LOG = "LOG ERROR";
    public static final String NO_REGEX = "爬取规则未设置";
    public static final String NO_INIT_URL = "初始网址未设置";
    public static final String GSPIDER_LOOK = "Gspider Look Status";
    public static final String PENDING_NULL = "pendingUrlList is null";
    public static final String PATTERNS_NULL = "patterns is null";

    /**
     * GSpiderBuilder
     */
    public static final int MULTI_THREAD_BASIC = 4;
    public static final int CONTROL_EXECUTOR_NUM = 1;

    /**
     * controller string
     */

    public static final String START = "start";
    public static final String STOP = "stop";
    public static final String ADD = "add";
    public static final String LOOK = "look";

    /**
     * http processor
     */

    public static final String GET = "GET";
    public static final String UTF8 = "UTF-8";
    public static final String GBK = "GBK";
    public static final String GB2312 = "GB2312";
    public static final String GB18030 = "GB18030";

    /**
     * processor
     */
    public static final String SERVICE_ERROR = "服务器错误";
    public static final String CATCH_URL_ERROR = "网页获取出错";

    /**
     * pageConfig
     */
    public static final int TIMEOUT = 10;
    public static final int SLEEPTIME = 2000;
    public static final int WAITTIME = 1000;
    public static final int CHECK_VISITEDLIST_SIZE = 500000;


}
